package standard;

/**
 * Create by Lingo
 */

public class PackageConfig {
    private String targetPackage = "";
    private String outputPathRoot = "src/main/java";
    private String modelName = "";
    //包后缀
    public String modelPackageName = "model";
    public String controllerPackageName = "controller";
    public String servicePackageName = "service";
    public String serviceImplPackageName = "service.impl";
    public String mapperPackageName = "mapper";
    //模板名
    public String modelTemplateName = "model.ftl";
    public String controllerTemplateName = "controller.ftl";
    public String controllerForXybbTemplateName = "controllerForXybb.ftl";
    public String serviceTemplateName = "service.ftl";
    public String serviceImpTemplateName = "serviceImpl.ftl";
    public String mapperTemplateName = "mapper.ftl";
    public String mapperXmlTemplateName = "mapperXml.ftl";
    //类名后缀
    public String modelClassSuffix = "";
    public String controllerClassSuffix = "Controller";
    public String serviceClassSuffix = "Service";
    public String serviceImplClassSuffix = "ServiceImpl";
    public String mapperClassSuffix = "Mapper";

    public PackageConfig() {
    }

    public void setTargetPackage(String targetPackage) {
        this.targetPackage = targetPackage;
    }

    public void setOutputPathRoot(String outputPathRoot) {
        this.outputPathRoot = outputPathRoot;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public void setModelPackageName(String modelPackageName) {
        this.modelPackageName = modelPackageName;
    }

    public void setControllerPackageName(String controllerPackageName) {
        this.controllerPackageName = controllerPackageName;
    }

    public void setServicePackageName(String servicePackageName) {
        this.servicePackageName = servicePackageName;
    }

    public void setServiceImplPackageName(String serviceImplPackageName) {
        this.serviceImplPackageName = serviceImplPackageName;
    }

    public void setMapperPackageName(String mapperPackageName) {
        this.mapperPackageName = mapperPackageName;
    }

    public void setModelTemplateName(String modelTemplateName) {
        this.modelTemplateName = modelTemplateName;
    }

    public void setControllerTemplateName(String controllerTemplateName) {
        this.controllerTemplateName = controllerTemplateName;
    }

    public void setServiceTemplateName(String serviceTemplateName) {
        this.serviceTemplateName = serviceTemplateName;
    }

    public void setServiceImpTemplateName(String serviceImpTemplateName) {
        this.serviceImpTemplateName = serviceImpTemplateName;
    }

    public void setMapperTemplateName(String mapperTemplateName) {
        this.mapperTemplateName = mapperTemplateName;
    }

    public void setMapperXmlTemplateName(String mapperXmlTemplateName) {
        this.mapperXmlTemplateName = mapperXmlTemplateName;
    }

    public void setModelClassSuffix(String modelClassSuffix) {
        this.modelClassSuffix = modelClassSuffix;
    }

    public void setControllerClassSuffix(String controllerClassSuffix) {
        this.controllerClassSuffix = controllerClassSuffix;
    }

    public void setServiceClassSuffix(String serviceClassSuffix) {
        this.serviceClassSuffix = serviceClassSuffix;
    }

    public void setServiceImplClassSuffix(String serviceImplClassSuffix) {
        this.serviceImplClassSuffix = serviceImplClassSuffix;
    }

    public void setMapperClassSuffix(String mapperClassSuffix) {
        this.mapperClassSuffix = mapperClassSuffix;
    }

    public String getModelRoot(){
        return outputPathRoot + "/" + targetPackage.replace(".","/");
    }

    public String getModelTemplateName() {
        return modelTemplateName;
    }

    public String getControllerTemplateName() {
        return controllerTemplateName;
    }

    public String getServiceTemplateName() {
        return serviceTemplateName;
    }

    public String getServiceImpTemplateName() {
        return serviceImpTemplateName;
    }

    public String getMapperTemplateName() {
        return mapperTemplateName;
    }

    public String getMapperXmlTemplateName() {
        return mapperXmlTemplateName;
    }

    public String getControllerForXybbTemplateName() {
        return controllerForXybbTemplateName;
    }

    public void setControllerForXybbTemplateName(String controllerForXybbTemplateName) {
        this.controllerForXybbTemplateName = controllerForXybbTemplateName;
    }

    //获取有关包的一些信息
    public String getMapperPackage(){
        return targetPackage + "." + mapperPackageName;
    }

    public String getMapperClassName(){
        return modelName + mapperClassSuffix;
    }
    public String getMapperClassPath(){
        return getMapperPackage() + "." + getMapperClassName();
    }

    public String getMapperDirPath(){
        return getModelRoot() + "/" + mapperPackageName.replace(".","/");
    }

    public String getMapperFilePath(){
        return getMapperDirPath() + "/" + getMapperClassName().replace(".","/")+".java";
    }


    public String getModelPackage(){
        return targetPackage + "." + modelPackageName;
    }

    public String getModelClassName(){
        return modelName + modelClassSuffix;
    }
    public String getModelClassPath(){
        return getModelPackage() + "." + getModelClassName();
    }

    public String getModelDirPath(){
        return getModelRoot() + "/" + modelPackageName.replace(".","/");
    }

    public String getModelFilePath(){
        return getModelDirPath() + "/" + getModelClassName().replace(".","/")+".java";
    }


    public String getServicePackage(){
        return targetPackage + "." + servicePackageName;
    }

    public String getServiceClassName(){
        return modelName + serviceClassSuffix;
    }
    public String getServiceClassPath(){
        return getServicePackage() + "." + getServiceClassName();
    }

    public String getServiceDirPath(){
        return getModelRoot() + "/" + servicePackageName.replace(".","/");
    }

    public String getServiceFilePath(){
        return getServiceDirPath() + "/" + getServiceClassName().replace(".","/")+".java";
    }

    public String getServiceImplPackage(){
        return targetPackage + "." + serviceImplPackageName;
    }

    public String getServiceImplClassName(){
        return modelName + serviceImplClassSuffix;
    }
    public String getServiceImplClassPath(){
        return getServiceImplPackage() + "." + getServiceImplClassName();
    }

    public String getServiceImplDirPath(){
        return getModelRoot() + "/" + serviceImplPackageName.replace(".","/");
    }

    public String getServiceImplFilePath(){
        return getServiceImplDirPath() + "/" + getServiceImplClassName().replace(".","/")+".java";
    }

    public String getControllerPackage(){
        return targetPackage + "." + controllerPackageName;
    }

    public String getControllerClassName(){
        return modelName + controllerClassSuffix;
    }
    public String getControllerClassPath(){
        return getControllerPackage() + "." + getControllerClassName();
    }

    public String getControllerDirPath(){
        return getModelRoot() + "/" + controllerPackageName.replace(".","/");
    }

    public String getControllerFilePath(){
        return getControllerDirPath() + "/" + getControllerClassName().replace(".","/")+".java";
    }

    public String getMapperXmlPackage(){
        return getMapperPackage();
    }

    public String getMapperXmlDirPath(){
        return getMapperDirPath();
    }

    public String getMapperXmlFilePath(){
        return getMapperXmlDirPath() + "/" + getMapperClassName()+".xml";
    }

}
